package com.lwq.lwqmicoservice.common.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * Description:
 * Author: LiuWenQing
 * Datetime: 2021/6/15
 */
@Component
@ConfigurationProperties(prefix = "upload")
public class CoreConfig {

    /** 上传路径 */
    private static String path;

    public static String getPath()
    {
        return path;
    }
    public void setPath(String path)
    {
        CoreConfig.path = path;
    }

    /**
     * 获取头像上传路径
     */
    public static String getAvatarPath()
    {
        return getPath() + "/avatar";
    }

    /**
     * 获取下载路径
     */
    public static String getDownloadPath()
    {
        return getPath() + "/download/";
    }

    /**
     * 获取上传路径
     */
    public static String getUploadPath()
    {
        return getPath() + "/upload";
    }
}
